Newer
Older
3d / Toothbrush holder.scad
$fn = 100;
dis = 35;
hei = 20;
screw_holes = false;
scr1 = 0;
scr2 = 0;

module base_holder()
{
    union()
    {
        difference()
        {
            union()
            {
                hull()
                {
                    translate([ -4, -4, -0 ]) cube([ 1, 8, 5 ]);
                    translate([ 12.5 - 13 - 19.8, -7.5, -0 ]) cube([ 0.0001, 15, 5 ]);
                }
                translate([ 0, 0, 0 ]) scale([ 3.3, 2.75, 0.5 ]) cylinder(d = 12, h = 10);
            }
            translate([ 7, -18, -1 ]) cube([ 15, 36, 10 ]);
            translate([ 0, 0, -1 ]) scale([ 3.3, 2.75, 0.5 ]) cylinder(d = 10, h = 14);
        }
        translate([ 7, 13.93, 0 ]) cylinder(h = 5, d = 2.95);
        translate([ 7, -13.93, 0 ]) cylinder(h = 5, d = 2.95);
    }
}

union()
{
    for (i = [0:3]) {
        translate([ 0, dis * i, 0 ]) base_holder();
    };
    translate([ -.5, 0, 0 ]) difference()
    {
        translate([ -23, -7.5, 0 ]) cube([ 3.5, dis * 3 + 15, 5 ]);
        if (screw_holes) {
            translate([ -23.5, dis * 0.5, 2.5 ]) rotate([ 0, 90, 0 ]) cylinder(h = 10, d = scr1);
            translate([ -20.4, dis * 0.5, 2.5 ]) rotate([ 0, 90, 0 ])
                cylinder(h = 1, d1 = 4, d2 = scr2);
            translate([ -23.5, dis * 2.5, 2.5 ]) rotate([ 0, 90, 0 ]) cylinder(h = 4, d = scr1);
            translate([ -20.4, dis * 2.5, 2.5 ]) rotate([ 0, 90, 0 ])
                cylinder(h = 1, d1 = 4, d2 = scr2);
        }
    }
};
// p2

module top_holder() {
    difference()
        {
            union()
            {
                hull()
                {
                    translate([ -4, -4, -0 ]) cube([ 1, 8, 5 ]);
                    translate([ 12.5 - 13 - 19.8, -7.5, -0 ]) cube([ 0.0001, 15, 5 ]);
                }
                translate([ 0, 0, 0 ]) cylinder(h = 5, d = 10);
            }

            hull()
            {
                translate([ 0, 0, -1 ]) cylinder(h = 7, d = 8);
                translate([ 1, 0, -1 ]) cylinder(h = 7, d = 7.5);
            }
            translate([ 2, -18, -1 ]) cube([ 15, 36, 10 ]);
        };
}

union()
{
    translate([ -0.5, 0, hei ]) union()
    {
        for (i = [0:3]) {
            translate([ 0, dis * i, 0 ]) top_holder();
        };
        difference()
        {
            translate([ -23, -7.5, 0 ]) cube([ 3, dis * 3 + 15, 5 ]);
            if (screw_holes) {
                translate([ -23.5, dis * 0.5, 2.5 ]) rotate([ 0, 90, 0 ]) cylinder(h = 10, d = scr1);
                translate([ -20.9, dis * 0.5, 2.5 ]) rotate([ 0, 90, 0 ])
                    cylinder(h = 1, d1 = 4, d2 = scr2);
                translate([ -23.5, dis * 2.5, 2.5 ]) rotate([ 0, 90, 0 ]) cylinder(h = 4, d = scr1);
                translate([ -20.9, dis * 2.5, 2.5 ]) rotate([ 0, 90, 0 ])
                    cylinder(h = 1, d1 = scr1, d2 = scr2);
            }
        };
    };
};